
using System;
using System.Collections;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
 // ERROR: Not supported in C#: OptionDeclaration
namespace NCS_CS
{
	internal class CTran
	{
		//Dim rec As ADODB.Recordset
//UPGRADE_NOTE: Class_Initialize was upgraded to Class_Initialize_Renamed. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'

		public CTran() : base()
		{

		}



        //protected override void Finalize()
        //{
        //    base.Finalize();
        //}
		public string MyTranslate(string s0, string s1)
		{
            //switch (ModMain.program1.l) {
            //    case 1:
            //        //MyTranslate = s1
            //        //treate(s0, s1)
            //        return s1;
            //    case 0:
            //        return s0;
            //    default:
            //        return s0;
            //}
            return s0;
		}
		public void addrec(ref string s0, ref string s1)
		{
			//Dim n(1) As String
			//Dim v(1) As String
			//n(0) = "cn": n(1) = "en"
			//v(0) = s0: v(1) = s1
			//rec.AddNew()
			//rec.Fields("cn").value = s0
			//rec.Fields("en").value = s1
			//rec.Update()
		}
		public string findfield(ref string s1)
		{
			//findfield = getFieldStr(rec.Fields("en"))
			return "";
		}
		public string treate(ref string s0, ref string s1)
		{
			string functionReturnValue = null;
			if (Findrec(ref s0)) {
				functionReturnValue = findfield(ref s1);
			} else {
				addrec(ref s0, ref s1);
				functionReturnValue = s1;
			}
			return functionReturnValue;
		}
		public bool Findrec(ref string s0)
		{
			//Dim s As String
			//s = "cn='" & s0 & "'"
			//If rec.RecordCount = 0 Then Findrec = False : Exit Function
			//rec.MoveFirst()
			//rec.find((s))
			//If rec.EOF Then
			//	Findrec = False
			//Else
			//	Findrec = True
			//End If
            return false;
		}
	}
}
